<template>
	<div class="all">
		<div class="top">
			<div class="hei k1">原ICCID卡号</div>
			<div style="margin-bottom: 0.3rem;">
				<van-field v-model="yvalue" disabled placeholder="请输入ICCID卡号" />
			</div>

			<div class="hei k1">ICCID卡号</div>
			<div>
				<van-field v-model="value" placeholder="请输入ICCID卡号" />
			</div>
			<div class="k2 btn" @click="genghuan">确定</div>
			<div class="k3">* 更换流量卡须知</div>
			<div class="hei">换卡将会完整继承您原卡的流量结余、套餐等信息，但 仍然需要您再次操作实名认证</div>
		</div>
	</div>
</template>

<script>
	import axios from 'axios'
	import top from '@/components/top.vue'
	import bus from '@/assets/bus.js'
	export default {
		name: 'genghuan',
		components: {
			top
		},
		data() {
			return {
				value: "",
				yvalue:""
			}
		},
		watch: {
			// num:function(newValue, oldValue) {
			//   console.log(newValue, oldValue)
			// }
		},
		computed: {
			// zongjia:function(){
			//   return this.num * 100
			// }
		},
		created() {
			this.yvalue = this.$route.query.canshu

		},
		methods: {
			genghuan:function(){
				this.axios.post(this.url + `/mobile/api/changeCard?newIccid=${this.value}&oldIccid=${this.yvalue}`)
					.then(response => {
						if(response.data.success == true){
							this.$toast('已更改');
							setTimeout(() => {
								this.$router.push('/')
							},1000)
						}else{
							this.$toast(response.data.message);
						}
					})
			}
		},

	}
</script>

<style scoped lang="less">
	.all {
		background: #FFFFFF;
		font-size: 0.28rem;
		min-height: 100vh;

		.top {}

		.k1 {
			margin-bottom: 0.3rem;
		}

		.k3 {
			color: #FF6367;
			margin-bottom: 0.2rem;
		}

		.k2 {
			margin: 0.5rem 0;
		}

		.van-field {
			background: #F7F7F7;
		}
	}
</style>
